#****************************************************************************
#
# COPYRIGHT(C) JONAS 'SORTIE' TERMANSEN 2010.
#
# This file is part of Maxsi Technology.
#
#****************************************************************************

# Detect the name of the kernel.
UNAME     := $(shell uname)

# Detect whether we are running 32-bit or 64-bit or whatever.
ifeq ($(UNAME),Linux)
LBITS    := $(shell getconf LONG_BIT)
else
LBITS    := $(shell ../Makefiles/GetPointerWidth.exe)
endif

# Set the used compilers
CC        = g++
WNDRES    = windres

# Set the file extensions in use for this project depending on the operating system.
SRCEXT    = .cpp
OBJEXT    = .o
RCEXT     = .rc
ROBJEXT   = .resobj
HEXT      = .h
PCHEXT    = .h.gch
ifeq ($(UNAME),Linux)
EXEEXT    =
DLLEXT    = .so
else
EXEEXT    = .exe
DLLEXT    = .dll
endif

# Set the paths to various folders.
BINDIR    = ../bin$(LBITS)
LIBDIR    = ../lib$(LBITS)
OUTDIR    = $(BINDIR)

# Some useful stuff
ifeq ($(UNAME),Linux)
OS_MAXSIENGINE_LIBS =
else
OS_MAXSIENGINE_LIBS =
endif
MAXSIENGINE_INCLUDE_DIRS = -I../MaxsiEngine/
MAXSIENGINE_LIBS = $(BINDIR)/MaxsiEngine$(DLLEXT) $(OS_MAXSIENGINE_LIBS)

MAXSIDISTRIBUTION_INCLUDE_DIRS = -I../MaxsiDistribution/
MAXSIDISTRIBUTION_LIBS = $(BINDIR)/MaxsiDistribution$(DLLEXT)

